<template>
	<view style="padding: 30rpx;text-align: center;">
		<view style="width: 100%;display: block;background-color: #FFFFFF;height: 800rpx;border-radius: 20rpx;padding: 40rpx;text-align: center;">
			<view style="text-align: center;">
				
				<text style="text-align: center;color: rgba(0,0,0,0.6);">微信号：{{wechat}}</text>
				<u-button plain size="mini" :custom-style="customStyle" shape="circle" @click="copy()">复制</u-button>
			</view>
			<view style="margin-top: 100rpx;">
				<image :src="img" mode="" style="width: 400rpx;height: 400rpx;" :show-menu-by-longpress ="true"></image>
			</view>
			<view style="margin-top: 100rpx;">
				<text style="text-align: center;color: rgba(0,0,0,0.6);">长按或扫一扫上面的二维码图案</text>
			</view>
			<view class="">
				<text style="text-align: center;color: rgba(0,0,0,0.6);">添加客服微信</text>
			</view>
		</view>
		<view style="margin-top: 30rpx;">
			<text style="font-size: 30rpx;color: rgba(0,0,0,0.6);">客服工作时间：10:00-22:00</text>
		</view>
		<view style="margin-top: 30rpx;">
			<u-button type="primary"  :custom-style="{'backgroundColor':'#EA5344','color':'#FFFFFF','borderColor':'#EA5344'}" open-type="contact" style="width: 80%;" shape="square">在线客服</u-button>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img:"",
				customStyle:{
					'color':'#EA5344',
					'marginLeft':'10rpx',
					'height':'40rpx'
				},
				wechat:'ruikeit'
			}
		},
		onLoad() {
			this.getwechat()
		},
		methods: {
			getwechat(){
				let that =this;
				uni.request({
					url:'https://psl.benyiit.com/api/pslapi/getwechat',
					success: (res) => {
						if(res.data.code===1){
							that.wechat = res.data.data[0].wechat
							that.img = 'https://psl.benyiit.com'+res.data.data[0].wx_image
						}
					}
				})
			},
			copy(){
				uni.setClipboardData({
				    data: this.wechat,
				    success: function () {
				        uni.showToast({
				        	title: '已复制',
				        	icon: 'none'
				        })
				    }
				});
			}
		}
	}
</script>

<style>
page{
	background-color: #F5F3F6 ;
}
button::after{ border: none;}
</style>
